/**
 * Created by zjw on 16/8/31.
 */
require.config({
    baseUrl: '../src',
    paths: {
        'jquery': '../deps/jquery/jquery',
        'angular': '../deps/angularjs/angular',
        'ui.router': '../deps/ui-router/angular-ui-router',
        'ui.bootstrap': '../deps/ui-bootstrap/js/ui-bootstrap',
        'ui.bootstrap.tpls': '../deps/ui-bootstrap/js/ui-bootstrap-tpls',
        'oclazyload': '../deps/oclazyload/oclazyload',
        'webix': '../deps/webix/webix_debug',
        'webix.angular': '../deps/webix-angular/webix-angular',
    },

    shim: {
        'ui.router': ['angular'],
        'oclazyload': ['angular'],
        'webix': ['angular'],
        'webix.angular': ['webix'],
        // 'common/lazyload': ['angular'],
        'ui.bootstrap': ['angular', 'jquery'],
        'ui.bootstrap.tpls': ['ui.bootstrap'],
    }
});

require(['common/lazyload', 'angular', 'webix', 'webix.angular', 'ui.bootstrap', 'ui.bootstrap.tpls', 'jquery', 'ui.router', 'oclazyload'], function(lazy) {

    var app = angular.module('app', ['ui.bootstrap', 'ui.router', 'oc.lazyLoad', 'webix']);
    lazy.makeLazy(app);

    require(['app'], function() {
        angular.element(document).ready(function() {
            angular.bootstrap(document, ['app']);
        });
    })
});